package PenTest.alibaba.ali;

public class Main1{
    public static boolean isTrue(int[] x,int[] y){
      int absTar=getAbs(x,y,0);;
      for(int i=1;i<4;i++){
        int currAbs=getAbs(x,y,i);
        if(currAbs!=absTar){
          return false;
        }
      }
      return true;
    }
    private static int getAbs(int[] x,int[] y,int index){
        int xS=x[index];
        int yS=y[index];
        int absAll=0;
        for(int i=0;i<4;i++){
          int currX=x[i];
          int currY=y[i];
          absAll+=Math.abs(currY-yS)+Math.abs(currX-xS);
        }
        return absAll;
    }

    public static void main(String[] args) {
        boolean aTrue = isTrue(new int[]{0, 1, 1, 0}, new int[]{0, 0, 1, 1});
        System.out.println(aTrue);
    }
}